package com.chenfan.mcn.model.vo;

import com.chenfan.mcn.enums.PaidStatusEnum;
import com.chenfan.mcn.enums.StarMonthlySettlementStatusEnum;
import com.chenfan.mcn.model.StarMonthlySettlement;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;
import java.util.Objects;

/**
 * 红人结算单详情VO
 *
 * @author wulg
 * @date 2022-01-14
 **/
@EqualsAndHashCode(callSuper = false)
@Data
public class StarMonthlySettlementDetailVO extends StarMonthlySettlement {

    private static final long serialVersionUID = 2794712202765321276L;

    /**
     * 单据状态名称
     */
    private String approvalStatusName;

    /**
     * 线上打款状态名称
     */
    private String onlinePaidStatusName;

    /**
     * 线下打款状态名称
     */
    private String offlinePaidStatusName;

    /**
     * 当前审批流程ID
     */
    private Long flowId;

    /**
     * 审批流程ID集合-含撤回等
     */
    private String flowIds;

    /**
     * 审批节点名称
     */
    private String flowStatusName;

    /**
     * 红人昵称
     */
    private String starNickname;

    /**
     * 红人类型
     */
    private Integer starType;

    /**
     * 所属部门名称
     */
    private String departmentName;

    /**
     * 子结算单信息集合
     */
    private List<StarMonthlySettlementSubVO> subSettlementList;

    /**
     * 收款账户信息
     */
    private StarSettlementAccountInfoVO starAccountInfoVO;

    /**
     * 执行单列表
     */
    private List<BasicExcutionOrderVO> excutionOrdersVOs;

    public String getApprovalStatusName() {
        if (Objects.nonNull(getApprovalStatus())) {
            return StarMonthlySettlementStatusEnum.getStatusName(getApprovalStatus());
        }
        return null;
    }

    public String getOnlinePaidStatusName() {
        if (Objects.nonNull(getOnlinePaidStatus())) {
            return PaidStatusEnum.getStatusName(getOnlinePaidStatus());
        }
        return null;
    }

    public String getOfflinePaidStatusName() {
        if (Objects.nonNull(getOfflinePaidStatus())) {
            return PaidStatusEnum.getStatusName(getOfflinePaidStatus());
        }
        return null;
    }
}
